home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / X11 / XChangeKeyboardControl.z / XChangeKeyboardControl
Encoding:
Text File  |  1998-10-30  |  13.7 KB  |  289 lines

  1.  
  2.  
  3.  
  4.      XXXXCCCChhhhaaaannnnggggeeeeKKKKeeeeyyyybbbbooooaaaarrrrddddCCCCoooonnnnttttrrrroooollll((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXCCCChhhhaaaannnnggggeeeeKKKKeeeeyyyybbbbooooaaaarrrrddddCCCCoooonnnnttttrrrroooollll((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XChangeKeyboardControl, XGetKeyboardControl, XAutoRepeatOn,
  10.           XAutoRepeatOff, XBell, XQueryKeymap, XKeyboardControl -
  11.           manipulate keyboard settings and keyboard control structure
  12.  
  13.      SSSSYYYYNNNNTTTTAAAAXXXX
  14.           XChangeKeyboardControl(_d_i_s_p_l_a_y, _v_a_l_u_e__m_a_s_k, _v_a_l_u_e_s)
  15.                 Display *_d_i_s_p_l_a_y;
  16.                 unsigned long _v_a_l_u_e__m_a_s_k;
  17.                 XKeyboardControl *_v_a_l_u_e_s;
  18.  
  19.           XGetKeyboardControl(_d_i_s_p_l_a_y, _v_a_l_u_e_s__r_e_t_u_r_n)
  20.                 Display *_d_i_s_p_l_a_y;
  21.                 XKeyboardState *_v_a_l_u_e_s__r_e_t_u_r_n;
  22.  
  23.           XAutoRepeatOn(_d_i_s_p_l_a_y)
  24.                 Display *_d_i_s_p_l_a_y;
  25.  
  26.           XAutoRepeatOff(_d_i_s_p_l_a_y)
  27.                 Display *_d_i_s_p_l_a_y;
  28.  
  29.           XBell(_d_i_s_p_l_a_y, _p_e_r_c_e_n_t)
  30.                 Display *_d_i_s_p_l_a_y;
  31.                 int _p_e_r_c_e_n_t;
  32.  
  33.           XQueryKeymap(_d_i_s_p_l_a_y, _k_e_y_s__r_e_t_u_r_n)
  34.                 Display *_d_i_s_p_l_a_y;
  35.                 char _k_e_y_s__r_e_t_u_r_n[32];
  36.  
  37.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  38.           _d_i_s_p_l_a_y   Specifies the connection to the X server.
  39.  
  40.           _k_e_y_s__r_e_t_u_r_n
  41.                     Returns an array of bytes that identifies which
  42.                     keys are pressed down.  Each bit represents one
  43.                     key of the keyboard.
  44.  
  45.           _p_e_r_c_e_n_t   Specifies the volume for the bell, which can range
  46.                     from -100 to 100 inclusive.
  47.  
  48.           _v_a_l_u_e__m_a_s_k
  49.                     Specifies which controls to change.  This mask is
  50.                     the bitwise inclusive OR of the valid control mask
  51.                     bits.
  52.  
  53.           _v_a_l_u_e_s    Specifies one value for each bit set to 1 in the
  54.                     mask.
  55.  
  56.           _v_a_l_u_e_s__r_e_t_u_r_n
  57.                     Returns the current keyboard controls in the
  58.                     specified _X_K_e_y_b_o_a_r_d_S_t_a_t_e structure.
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXCCCChhhhaaaannnnggggeeeeKKKKeeeeyyyybbbbooooaaaarrrrddddCCCCoooonnnnttttrrrroooollll((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXCCCChhhhaaaannnnggggeeeeKKKKeeeeyyyybbbbooooaaaarrrrddddCCCCoooonnnnttttrrrroooollll((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  75.           The _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l function controls the keyboard
  76.           characteristics defined by the _X_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l structure.
  77.           The value_mask argument specifies which values are to be
  78.           changed.
  79.  
  80.           _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l can generate _B_a_d_M_a_t_c_h and _B_a_d_V_a_l_u_e
  81.           errors.
  82.  
  83.           The _X_G_e_t_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l function returns the current control
  84.           values for the keyboard to the _X_K_e_y_b_o_a_r_d_S_t_a_t_e structure.
  85.  
  86.           The _X_A_u_t_o_R_e_p_e_a_t_O_n function turns on auto-repeat for the
  87.           keyboard on the specified display.
  88.  
  89.           The _X_A_u_t_o_R_e_p_e_a_t_O_f_f function turns off auto-repeat for the
  90.           keyboard on the specified display.
  91.  
  92.           The _X_B_e_l_l function rings the bell on the keyboard on the
  93.           specified display, if possible.  The specified volume is
  94.           relative to the base volume for the keyboard.  If the value
  95.           for the percent argument is not in the range -100 to 100
  96.           inclusive, a _B_a_d_V_a_l_u_e error results.  The volume at which
  97.           the bell rings when the percent argument is nonnegative is:
  98.  
  99.                base - [(base * percent) / 100] + percent
  100.  
  101.           The volume at which the bell rings when the percent argument
  102.           is negative is:
  103.  
  104.                base + [(base * percent) / 100]
  105.  
  106.           To change the base volume of the bell, use
  107.           _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l.
  108.  
  109.           _X_B_e_l_l can generate a _B_a_d_V_a_l_u_e error.
  110.  
  111.           The _X_Q_u_e_r_y_K_e_y_m_a_p function returns a bit vector for the
  112.           logical state of the keyboard, where each bit set to 1
  113.           indicates that the corresponding key is currently pressed
  114.           down.  The vector is represented as 32 bytes.  Byte N (from
  115.           0) contains the bits for keys 8N to 8N + 7 with the least
  116.           significant bit in the byte representing key 8N.
  117.  
  118.           Note that the logical state of a device (as seen by client
  119.           applications) may lag the physical state if device event
  120.           processing is frozen.
  121.  
  122.      SSSSTTTTRRRRUUUUCCCCTTTTUUUURRRREEEESSSS
  123.           The _X_K_e_y_b_o_a_r_d_C_o_n_t_r_o_l structure contains:
  124.  
  125.           /* Mask bits for ChangeKeyboardControl */
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXCCCChhhhaaaannnnggggeeeeKKKKeeeeyyyybbbbooooaaaarrrrddddCCCCoooonnnnttttrrrroooollll((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXCCCChhhhaaaannnnggggeeeeKKKKeeeeyyyybbbbooooaaaarrrrddddCCCCoooonnnnttttrrrroooollll((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.           #define
  141.                     _K_B_K_e_y_C_l_i_c_k_P_e_r_c_e_n_t
  142.                                                 (1L<<0)
  143.           #define
  144.                     _K_B_B_e_l_l_P_e_r_c_e_n_t
  145.                                                 (1L<<1)
  146.           #define
  147.                     _K_B_B_e_l_l_P_i_t_c_h
  148.                                                 (1L<<2)
  149.           #define
  150.                     _K_B_B_e_l_l_D_u_r_a_t_i_o_n
  151.                                                 (1L<<3)
  152.           #define
  153.                     _K_B_L_e_d
  154.                                                 (1L<<4)
  155.           #define
  156.                     _K_B_L_e_d_M_o_d_e
  157.                                                 (1L<<5)
  158.           #define
  159.                     _K_B_K_e_y
  160.                                                 (1L<<6)
  161.           #define
  162.                     _K_B_A_u_t_o_R_e_p_e_a_t_M_o_d_e
  163.                                                 (1L<<7)
  164.           /* Values */
  165.  
  166.           typedef struct {
  167.                int key_click_percent;
  168.                int bell_percent;
  169.                int bell_pitch;
  170.                int bell_duration;
  171.                int led;
  172.                int led_mode;       /* LedModeOn, LedModeOff */
  173.                int key;
  174.                int auto_repeat_mode;/* AutoRepeatModeOff, AutoRepeatModeOn,
  175.                                       AutoRepeatModeDefault */
  176.           } XKeyboardControl;
  177.  
  178.           The key_click_percent member sets the volume for key clicks
  179.           between 0 (off) and 100 (loud) inclusive, if possible. A
  180.           setting of -1 restores the default.  Other negative values
  181.           generate a _B_a_d_V_a_l_u_e error.
  182.  
  183.           The bell_percent sets the base volume for the bell between 0
  184.           (off) and 100 (loud) inclusive, if possible. A setting of -1
  185.           restores the default.  Other negative values generate a
  186.           _B_a_d_V_a_l_u_e error.  The bell_pitch member sets the pitch
  187.           (specified in Hz) of the bell, if possible.  A setting of -1
  188.           restores the default.  Other negative values generate a
  189.           _B_a_d_V_a_l_u_e error.  The bell_duration member sets the duration
  190.           of the bell specified in milliseconds, if possible. A
  191.           setting of -1 restores the default.  Other negative values
  192.           generate a _B_a_d_V_a_l_u_e error.
  193.  
  194.           If both the led_mode and led members are specified, the
  195.           state of that LED is changed, if possible. The led_mode
  196.           member can be set to _L_e_d_M_o_d_e_O_n or _L_e_d_M_o_d_e_O_f_f.  If only
  197.           led_mode is specified, the state of all LEDs are changed, if
  198.           possible. At most 32 LEDs numbered from one are supported.
  199.           No standard interpretation of LEDs is defined.  If led is
  200.           specified without led_mode, a _B_a_d_M_a_t_c_h error results.
  201.  
  202.           If both the auto_repeat_mode and key members are specified,
  203.           the auto_repeat_mode of that key is changed (according to
  204.           _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_n, _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_f_f, or
  205.           _A_u_t_o_R_e_p_e_a_t_M_o_d_e_D_e_f_a_u_l_t), if possible.  If only
  206.           auto_repeat_mode is specified, the global auto_repeat_mode
  207.           for the entire keyboard is changed, if possible, and does
  208.  
  209.  
  210.  
  211.      Page 3                                          (printed 4/30/98)
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.      XXXXCCCChhhhaaaannnnggggeeeeKKKKeeeeyyyybbbbooooaaaarrrrddddCCCCoooonnnnttttrrrroooollll((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXCCCChhhhaaaannnnggggeeeeKKKKeeeeyyyybbbbooooaaaarrrrddddCCCCoooonnnnttttrrrroooollll((((3333XXXX11111111))))
  219.  
  220.  
  221.  
  222.           not affect the per-key settings.  If a key is specified
  223.           without an auto_repeat_mode, a _B_a_d_M_a_t_c_h error results.  Each
  224.           key has an individual mode of whether or not it should
  225.           auto-repeat and a default setting for the mode.  In
  226.           addition, there is a global mode of whether auto-repeat
  227.           should be enabled or not and a default setting for that
  228.           mode.  When global mode is _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_n, keys should
  229.           obey their individual auto-repeat modes.  When global mode
  230.           is _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_f_f, no keys should auto-repeat.  An auto-
  231.           repeating key generates alternating _K_e_y_P_r_e_s_s and _K_e_y_R_e_l_e_a_s_e
  232.           events.  When a key is used as a modifier, it is desirable
  233.           for the key not to auto-repeat, regardless of its auto-
  234.           repeat setting.
  235.  
  236.           The _X_K_e_y_b_o_a_r_d_S_t_a_t_e structure contains:
  237.  
  238.           typedef struct {
  239.                int key_click_percent;
  240.                int bell_percent;
  241.                unsigned int bell_pitch, bell_duration;
  242.                unsigned long led_mask;
  243.                int global_auto_repeat;
  244.                char auto_repeats[32];
  245.           } XKeyboardState;
  246.  
  247.           For the LEDs, the least significant bit of led_mask
  248.           corresponds to LED one, and each bit set to 1 in led_mask
  249.           indicates an LED that is lit.  The global_auto_repeat member
  250.           can be set to _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_n or _A_u_t_o_R_e_p_e_a_t_M_o_d_e_O_f_f.  The
  251.           auto_repeats member is a bit vector.  Each bit set to 1
  252.           indicates that auto-repeat is enabled for the corresponding
  253.           key.  The vector is represented as 32 bytes. Byte N (from 0)
  254.           contains the bits for keys 8N to 8N + 7 with the least
  255.           significant bit in the byte representing key 8N.
  256.  
  257.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  258.           _B_a_d_M_a_t_c_h  Some argument or pair of arguments has the correct
  259.                     type and range but fails to match in some other
  260.                     way required by the request.
  261.  
  262.           _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of
  263.                     values accepted by the request.  Unless a specific
  264.                     range is specified for an argument, the full range
  265.                     defined by the argument's type is accepted.  Any
  266.                     argument defined as a set of alternatives can
  267.                     generate this error.
  268.  
  269.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  270.           XChangeKeyboardMapping(3X11), XSetPointerMapping(3X11)
  271.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  272.  
  273.  
  274.  
  275.  
  276.  
  277.      Page 4                                          (printed 4/30/98)
  278.  
  279.  
  280.  
  281.